package com.bdqn.util;

import com.bdqn.dao.CheckWorkDao;
import com.bdqn.dao.Impl.CheckWorkDaoImpl;
import com.bdqn.entity.Employee;

public class Insert {
    private  static  CheckWorkDao dao = new CheckWorkDaoImpl();
    public static boolean insert(String date, String time, Employee emp){
        boolean flag;
        int count = dao.findByIdAndDate(emp.getEmpId(),date);
        if(count <=0){
            flag = dao.insertIntostart(time, date, emp.getEmpId());
            return flag;
        }else{
            flag=dao.insertIntoEnd(time, date,emp.getEmpId());
            return flag;
        }
    }
}
